<template>
	<view class="container">
		<text class="detail" @tap="navTo('/business/wallet/walletList')">钱包明细</text>
		<image class="icon" src="../../static/images/center/yue.png" mode=""></image>
		<view class="money">
			<text class="count">￥</text>
			<text class="count">{{Number(count).toFixed(2)}}</text>
		</view>
		<text class="title">钱包</text>

		<button class="btn withdraw" type="default"  @tap="goWithdraw">提现</button>
		<view class="bottom__explan" @tap="navTo('/pages/center/help/rulesDetail?type='+3)">
			<text class="cell-more yticon icon-zuo"></text>
			钱包说明
			<text class="cell-more yticon icon-you"></text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				count: 0,
				phone: '',
				is_checked: '',
				is_bind_bank: '',
				withdraw_pass: '',
			}
		},
		onShow() {
			// this.count = uni.getStorageSync('userInfo').now_money
// 			this.phone = uni.getStorageSync("userInfo").phone
// 			this.is_checked = uni.getStorageSync("userInfo").is_checked
// 			this.is_bind_bank = uni.getStorageSync("userInfo").is_bind_bank
			this.withdraw_pass = uni.getStorageSync("userInfo").withdraw_pass
			this.count = uni.getStorageSync("sellerInfo").balance
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			goWithdraw() {
				if (!this.withdraw_pass) {
					uni.showModal({
						content: "提现需设置操作密码",
						confirmText: "去设置",
						cancelText: "取消",
						confirmColor: "#57BE6A",
						success(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: "/pages/center/accountSet/payPassword/payPassword?backurl=true"
								})
							}
						}
					})
					return
				}
				uni.navigateTo({
					url: `/business/wallet/walletWithdraw?money=${this.count}`
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding-top: 150rpx;
		text-align: center;
		position: relative;

		.detail {
			position: absolute;
			width: 140rpx;
			height: 62rpx;
			border-radius: 31rpx;
			line-height: 62rpx;
			text-align: center;
			font-size: 24rpx;
			font-weight: bold;
			top: 30rpx;
			right: 30rpx;
			color: #fff;
			background-color: $theme-color;
		}

		.icon {
			display: block;
			margin: 0 auto;
			width: 150rpx;
			height: 150rpx;
			border-radius: 100rpx;
			background-color: $theme-color;
		}

		.money {
			color: rgba(51, 51, 51, 1);
			margin-top: 40rpx;

			text:nth-of-type(1) {
				font-size: 30rpx;
				font-weight: bold;
			}

			text:nth-of-type(2) {
				font-size: 50rpx;
				font-weight: bold;
			}
		}
		.title{
			margin-top: 26rpx;
			font-size:26rpx;
			font-weight:400;
			color:rgba(51,51,51,1);
		}
		.btn{
			border: none;
			width:600rpx;
			height:80rpx;
			background:$theme-color;
			border-radius:40rpx;
			color: #fff;
			line-height: 80rpx;
			font-size:34rpx;
			font-weight:bold;
			letter-spacing: 10rpx;
			position: fixed;
			left: 75rpx;
		}
		.withdraw{
			bottom: 280rpx,
		}
	}
</style>
